<?php
declare (strict_types=1);

namespace app\advertiser\validates;

use think\Validate;

/**
 * 广告主AdvertiserMatter验证器
 */
class AdvertiserMatterValidate extends Validate
{
    /**
     * 验证规则
     * @var array
     */
    protected $rule = [
        'id' => 'require|number',
        'appid' => 'require|chsDash|max:50',
        'name' => 'require|chsDash|max:50',
        'desc' => 'require|chsDash|max:255',
        'avatar' => 'require|max:255',
        'qrcode' => 'require|max:255',
    ];

    /**
     * 字段描述
     * @var string[]
     */
    protected $field = [
        'id' => '推广物ID',
        'appid' => 'APPID',
        'name' => '名称',
        'desc' => '描述',
        'avatar' => '头像',
        'qrcode' => '二维码',
    ];

    /**
     * 验证场景
     * @var array
     */
    protected $scene = [
        'add' => ['appid', 'name', 'desc', 'avatar', 'qrcode'],
        'edit' => ['id', 'name', 'desc', 'avatar', 'qrcode'],
    ];

}